<?php

Yii::import('zii.widgets.CPortlet');
Yii::import('application.modules.news.models.News');
Yii::import('application.modules.news.models.NewsCategories');

class HomeNews extends CPortlet {

    public function getNews() {
        $criteria = new CDbCriteria(array(
            'order' => 'create_time DESC',
        ));
        $criteria->compare('status', 1);
        $criteria->compare('news', 1);
        return News::model()->findAll($criteria);
    }

    protected function renderContent() {
        $this->render('homeNews');
    }

}

?>